<template>
    <view style="width:100%;height: 100%;" v-if="testSrc">
        <iframe   style="width: 100%; height: 100vh; border: 0"   frameborder="0" :src="testSrc"></iframe>
    </view>
</template>
<script setup>
import request from "@/utils/request";
// const url = 'http://150.158.135.236:8888/down/sVnjXWhExtX0.pdf'
const testSrc =  ref()
const route = useRoute();
// const { proxy } = getCurrentInstance();
// proxy.$modal.showLoading('加载中')
(() => {
  const id = route.params && route.params.id;
  console.log(id)
  request({
    url:'/ex/book/'+id,
    method:'get'
  }).then(res=>{
    console.log(res)
    let source = res.source;
    testSrc.value = "http://viewer.apisev.cn/viewer/preview/remote?url=" + source
  })
})();
</script>
<style>
</style>